<style type="text/css">
	.change
	{
		margin: 10px;
	}
</style>



<?php
require_once('functions.php');  
if (!empty($_POST))
{
	$value = (float)$_POST['q'] ;
	$query="UPDATE  `aa_warehouses` SET  `exchangeRate` =  '".$value."' WHERE  `id` = ".$_POST['id'];
	$result=mysql_query($query, $db) or die("error 34");
	if ($result)
	{
		$query="INSERT INTO `aa_wh_log` (`id`, `server`, `action`, `identify`, `time`) VALUES (NULL, (SELECT server FROM aa_warehouses WHERE aa_warehouses.id = ".$_POST['id']." LIMIT 1), 'Установил курс валют склада в ".$value."', '".getIp()."', NOW());";
		$result=mysql_query($query, $db) or die("error 34");
	}
	redirect_php('wh.php'); die;
}
?>



<div class="change">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>	
		<form action="/changeRate.php" method="POST" >
			<input type="hidden" value="<?php echo (int)$_GET['s'] ?>" name='id'>
				<div class="input-group">
						<input pattern="\d+(\.\d+)?"  maxlength="8" size = "52" class="form-control"   name='q' placeholder="Сервер <?php echo (int)$_GET['s'] ?>"></input>
				</div>
				<div class="input-group">
					<br><input type="submit" class="btn btn-info" value="Изменить"> &nbsp;
					<button type="button" class="btn btn-info" data-dismiss="modal">Закрыть</button>
				</div>
			</form>
	
</div>


